Diff 2 or 3 files with Meld
Submitted by Anonymous Georges on Fri, 2006-06-23 18:26.

Description:

This nautilus-actions config file will allow you to get a "Diff with Meld" context menu entry whenever 2 or more plain text files are tselected.
Executing the command will send the files to Meld, a program which shows the differences between files in a graphical manner, which also allows merging the changes to the files.
The ability to see differences between files and to merge them is invaluable to programmers and system administrators, and can be very useful to other users as well. Now this can be done by simply right-clicking on the files to be diff'ed on Nautilus and choosing this action.
The config file is very simple, and can easily be modified to use some other graphical diff tool, such as k3diff, or to apply only to a certain type of files (at the moment, the MIME file type to which the config applies is simply set to text/*).
To Do:
------
The following is a list of things which need to be solved to make this config file more user-friendly. If anyone knows how to do them, comments or improvements will be greatly appreciated.
1. Although the "Appears if selection has multiple files or folders" is chosen on the "Conditions" tab, the "Diff with Meld" context menu entry will also show up when only one file is selected, which is pretty useless, since Meld won't diff a simple file. I'd like the action not to be shown when a single file is selected. I don't know whether this is a bug in n-a or just me failing to understand the purpose of the "Appears if selection has multiple files or folders" entry.
2. Since Meld can only take three "file" arguments, as in 'meld file1 file2 [file3]', it returns an error if more than 3 files are selected in Nautilus and the action is executed, since the names of all files in the selection are sent to Meld. I could not find a way to limit the number of files to be sent to the application. It would be nice to be able to tell the n-a action that only the 3 first selected filenames should be passed to the external application.

Configuration file:
downloadconfig_bca26922-dbe0-440f-9e0f-9cf3621cef74.schemas

Dependencies:

Meld graphical diff viewer, although the config file can easily be modified to use any diff viewer which can be executed as 'diff file1 file2 [file3]', where 'diff' is a generic name to be substituted by the program's executable name.

Installation notes:

Simply launch nautilus-actions, click on the Import/Export button, choose "Import new configuration" on the dialog that appears, and type or browse the location where you've downloaded this config file in the "File:" textbox.

Click "OK" and you are done.

Note: this config file assumes that the icon for the context menu entry resides in /usr/share/pixmaps/meld.png. If meld installs its icon at some other location on your particular distro or you want to use another icon, this location will have to be updated accordingly.